package org.zlb.manager.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/10 12:30
 */
public class OrgOperatorRulePK implements Serializable {
    private String operatorCode;
    private String menuCode;

    @Column(name = "OPERATOR_CODE")
    @Id
    public String getOperatorCode() {
        return operatorCode;
    }

    public void setOperatorCode(String operatorCode) {
        this.operatorCode = operatorCode;
    }

    @Column(name = "MENU_CODE")
    @Id
    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrgOperatorRulePK that = (OrgOperatorRulePK) o;
        return Objects.equals(operatorCode, that.operatorCode) &&
                Objects.equals(menuCode, that.menuCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(operatorCode, menuCode);
    }
}
